using System;
using System.Windows.Input;

namespace CodeGears.WorkItemTracking.ChartingDashboard
{
    public class DelegateCommand : ICommand
    {
        public Action Handler { get; set; }

        public DelegateCommand(Action handler)
        {
            Handler = handler;
        }

        public void Execute(object parameter)
        {
            Handler();
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
    }
}